package org.example.controller;

import jakarta.annotation.Resource;
import org.example.bean.Stoke;
import org.example.service.StokeService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther:Liu
 * @Testname:StokeController
 * @Date:2025/9/25 15:23
 */
@RestController
@RequestMapping("/stoke")
public class StokeController {
    @Resource
    private StokeService stokeService;

    @RequestMapping("/update_stoke/{gid}/{number}")
    String updateStoke(@PathVariable("gid") String gid, @PathVariable("number") Integer number) {
        Stoke stoke = new Stoke();
        stoke.setGid(gid);
        stoke.setNumber(number);
        boolean b = stokeService.save(stoke);
        return b ? "成功" : "失败";
    }
}
